home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Utilities / Workbench / MagicWB2.1p / Update Drawers < prev    next >
Text File  |  1998-06-24  |  5KB  |  139 lines

  1. failat 21
  2.  
  3. if not exists XEN-Icons
  4.   echo "*n Please change current directory to that of MagicWB *n or start the installation from the Workbench!*n"
  5.   quit
  6. endif
  7.  
  8. assign Magic: ""
  9.  
  10. echo "*n*e[1;32m ____________________________________________________________________"
  11. echo " *e[43m                                                                    *e[0m"
  12. echo " *e[0;32;43m             Welcome to MagicWB v2.1p: UPDATE DRAWERS*e[1m               *e[0m"
  13. echo " *e[1;4;43m                                                                    *e[0m"
  14. echo "*n*n This  small  installation  was  written to provide you with the most"
  15. echo " comfortable  way of replacing the old Drawer-Icons with the new ones"
  16. echo " from MagicWB."
  17. echo " *n If  you  have  found  old drawers on your Workbench, please remember"
  18. echo " the  PATH  where  they are located to provide this installation with"
  19. echo " the exact path so that it can update these drawers."
  20. echo " *n Comment:  This  installation  WILL  PRESERVE  the original positions"
  21. echo " of  your  old  drawers.  Only  the old Drawer-Images will be changed."
  22. echo " So, don't be afraid.  You  will  NOT  lose your old drawer snapshots.*n"
  23. echo " This  installation  even  takes  care of the new Image-Drawers which"
  24. echo " means  that  it  recognizes these Image-Drawers and does not replace"
  25. echo " them  with  the default drawer in that case. This saves you a lot of"
  26. echo " work.  You  can even update your SYS: partition without any concerns."
  27. echo noline "*n Start the Drawer-Update? "
  28.  
  29. set > nil: InpVar ?
  30.  
  31. if $InpVar eq "ja"
  32.   skip Start
  33. endif
  34.  
  35. if $InpVar eq "j"
  36.   skip Start
  37. endif
  38.  
  39. if $InpVar eq "y"
  40.   skip Start
  41. endif
  42.  
  43. if $InpVar eq "yes"
  44.   skip Start
  45. endif
  46.  
  47. echo noline "*n*e[32m Update aborted."
  48. quit
  49.  
  50. lab Start
  51. resident IU programs/IconUpdate pure
  52. echo "*e[1;1H*e[J"
  53. echo "*n Information: You can always abort this installation by pressing"
  54. echo " CTRL-D (and, if needed, followed by pressing RETURN).*n"
  55. echo "*n You can decide now if you want to update the drawers ONLY"
  56. echo " IN THE DIRECTORY of the given path (= Normal mode) or INCLUDING"
  57. echo " ALL SUB-DIRECTORIES of the given path (= Recursive mode).*n"
  58. echo " If you want to do it in the normal mode enter N."
  59. echo " If you want to do it recursively enter R."
  60. echo noline "*n Which mode do you prefer? *e[32m"
  61. set Mode [Return]
  62. set > NIL: Mode ?
  63. if $Mode eq "N"
  64.   skip PathN
  65. endif
  66. if $Mode eq "R"
  67.   skip PathR
  68. endif
  69. echo "*n You have not selected the correct mode! Please try again..."
  70. wait 4
  71. skip back Start
  72.  
  73.  
  74. lab PathN
  75. echo noline "*e[0m*n*N Please enter the PATH where old Drawer-Icons are located: *e[32m"
  76. set > NIL: Path ?
  77. echo noline "*e[0m"
  78.   if > NIL: not exists $Path
  79.     echo " Wrong path, `$path' does not exist! Try again...*n"
  80.     skip back PathN
  81.   endif
  82. echo noline "*n*n Analysing $Path for any old drawers..."
  83. C:LIST > ram:MWB $Path dirs lformat "if exists *"%f%n.info*" *n  C:LIST > ram:Length *"%f%n.info*" nohead nodates *n  search > NIL: ram:Length 1233 *n  if not warn *n  else *n    search > NIL: ram:Length 2625 *n    if not warn *n    else *n      IU > NIL: cwn XEN-Icons/Prefs/Env-Archive/Sys/def_Drawer.info *"%f%n.info*" *n    endif *n  endif *nendif*n"
  84. echo ".....................*e[33mDONE*e[0m"
  85. echo noline " Updating Drawer-Icons in $Path..."
  86. failat 21
  87. execute > NIL: ram:MWB
  88. if warn
  89.   echo " Update has failed!!!"
  90.   skip end
  91. endif
  92. echo "..........................*e[33mDONE*e[0m"
  93. echo "*n*n*e[32m Drawer-Update successfully finished!*e[0m"
  94. skip trash
  95.  
  96.  
  97. lab PathR
  98. echo "*e[1;1H*e[J"
  99. echo "*n*n ATTENTION: This recursive mode might need a lot of memory! The amount"
  100. echo " of memory depends on how complex your directory structure is."
  101. echo "*n Example: If your partition has got 400 drawers this installation will"
  102. echo " approximately need 150 KB of memory. That are 300 bytes per directory."
  103. echo noline "*e[0m*N*n*N Please enter the PATH where old Drawer-Icons are located: *e[32m"
  104. set > NIL: Path ?
  105. echo noline "*e[0m"
  106.   if > NIL: not exists $Path
  107.     echo " Wrong path, `$path' does not exist! Try again...*n"
  108.     skip back PathR
  109.   endif
  110. echo noline "*n*n Recursively analysing $Path for any old drawers..."
  111. C:LIST > ram:MWB $Path dirs all lformat "if exists *"%f%n.info*" *n  C:LIST > ram:Length *"%f%n.info*" nohead nodates *n  search > NIL: ram:Length 1233 *n  if not warn *n  else *n    search > NIL: ram:Length 2625 *n    if not warn *n    else *n      IU > NIL: cwn XEN-Icons/Prefs/Env-Archive/Sys/def_Drawer.info *"%f%n.info*" *n    endif *n  endif *nendif*n"
  112. echo "........*e[33mDONE*e[0m"
  113. echo noline "*n Recursively updating Drawer-Icons in $Path..."
  114. failat 21
  115. execute > NIL: ram:MWB
  116. if warn
  117.   echo " Update has failed!!!"
  118.   skip end
  119. endif
  120. echo ".............*e[33mDONE*e[0m"
  121. echo "*n*n*e[32m Drawer-Update successfully finished!*e[0m"
  122.  
  123.  
  124. lab trash
  125.  
  126. cd $path
  127. if exists Trashcan.info
  128.   IU > NIL: cwn Magic:XEN-Icons/Prefs/Env-Archive/Sys/def_trashcan.info Trashcan.info
  129. endif
  130.  
  131.  
  132. lab end
  133. resident IU remove
  134. delete > NIL: ram:MWB
  135. delete > NIL: ram:Length
  136. assign Magic: remove
  137. wait 4
  138. quit
  139.